
#include <assert.h>
#include <stdio.h>
#include <string.h>

void reverse(char*left,char*right)
{
    assert(left);
    assert(right);
    while(left<right)
    {
        char tmp = *left;
        *left = *right;
        *right = tmp;
        left++;
        right--;
    }
}


void left_reverse(char arr[],int k)
{
    int len = strlen(arr);
    k %=len;
    reverse(arr,arr+k-1);
    reverse(arr+k,arr+len-1);
    reverse(arr,arr+len-1);
}

int main(void)
{
    char arr[] = "abcdef";
    int k = 1;
    // scanf("%d",&k);
    left_reverse(arr,k);
    printf("%s\n",arr);
    return 0;
}
